<div class="content-cover" {{action "closeSettingsMenu"}}></div>
{{#gh-tabs-manager selected="showSubview" id="entry-controls" class="settings-menu-container"}}
<div id="entry-controls">
    <div class="{{if isViewingSubview 'settings-menu-pane-out-left' 'settings-menu-pane-in'}} settings-menu settings-menu-pane">
        <div class="settings-menu-header">
            <h4>博文选项</h4>
            <button class="close icon-x settings-menu-header-action" {{action "closeSettingsMenu"}}><span class="hidden">关闭</span></button>
        </div>
        <div class="settings-menu-content">
            {{gh-uploader uploaded="setCoverImage" canceled="clearCoverImage" description="Add post image" image=model.image uploaderReference=uploaderReference tagName="section"}}
            <form>
            <div class="form-group">

                <label for="url">博文地址</label>
                {{#if model.isPublished}}
                <a class="post-view-link" target="_blank" href="{{model.absoluteUrl}}">
                    查看博文 <i class="icon-external"></i>
                </a>
                {{else}}
                <a class="post-view-link" target="_blank" href="{{model.previewUrl}}">
                    预览 <i class="icon-external"></i>
                </a>
                {{/if}}

                <span class="input-icon icon-link">
                    {{gh-input class="post-setting-slug" id="url" value=slugValue name="post-setting-slug" focus-out="updateSlug" selectOnClick="true" stopEnterKeyDownPropagation="true"}}
                </span>
                {{gh-url-preview slug=slugValue tagName="p" classNames="description"}}
            </div>

            <div class="form-group">
                <label for="post-setting-date">发布时间</label>
                <span class="input-icon icon-calendar">
                    {{gh-input class="post-setting-date" id="post-setting-date" value=publishedAtValue name="post-setting-date" focus-out="setPublishedAt" stopEnterKeyDownPropagation="true"}}
                </span>
            </div>

            {{#unless session.user.isAuthor}}
            <div class="form-group for-select">
                <label for="author-list">作者</label>
                <span class="input-icon icon-user">
                    <span class="gh-select" tabindex="0">
                    {{view "select"
                        name="post-setting-author"
                        id="author-list"
                        content=authors
                        optionValuePath="content.id"
                        optionLabelPath="content.name"
                        selection=selectedAuthor}}
                    </span>
                </span>
            </div>
            {{/unless}}

            <ul class="nav-list nav-list-block">
                {{#gh-tab tagName="li" classNames="nav-list-item"}}

                    <button type="button">
                        <b>搜索引擎优化</b>
                        <span>优化在搜索引擎中的呈现效果，提高访问量。</span>
                    </button>
                {{/gh-tab}}
            </ul>

            <div class="form-group for-checkbox">
                <label class="checkbox" for="static-page" {{action "togglePage" bubbles="false"}}>
                    {{input type="checkbox" name="static-page" id="static-page" class="post-setting-static-page" checked=model.page}}
                    <span class="input-toggle-component"></span>
                    <p>作为独立页面(不出现在博文列表)</p>
                </label>

                <label class="checkbox" for="featured" {{action "toggleFeatured" bubbles="false"}}>
                    {{input type="checkbox" name="featured" id="featured" class="post-setting-featured" checked=model.featured}}
                    <span class="input-toggle-component"></span>
                    <p>这是特殊页面(部分主题呈现样式不同)</p>
                </label>
            </div>

            </form>
        </div>{{! .settings-menu-content }}
    </div>{{! .post-settings-menu }}

    <div class="{{if isViewingSubview 'settings-menu-pane-in' 'settings-menu-pane-out-right'}} settings-menu settings-menu-pane">
    {{#gh-tab-pane}}
        {{#if isViewingSubview}}
        <div class="settings-menu-header subview">
            <button {{action "closeSubview"}} class="back icon-chevron-left settings-menu-header-action"><span class="hidden">Back</span></button>
            <h4>搜索引擎优化</h4>
        </div>

        <div class="settings-menu-content">
            <form>
            <div class="form-group">
                <label for="meta-title">呈现标题</label>
                {{gh-input class="post-setting-meta-title" id="meta-title" value=metaTitleScratch name="post-setting-meta-title" focus-out="setMetaTitle" stopEnterKeyDownPropagation="true"}}
                <p> <b>15</b> 字以内效果最佳。 已输入 {{gh-count-down-characters metaTitleScratch 15}} 个字</p>
            </div>

            <div class="form-group">
                <label for="meta-description">呈现摘要</label>
                {{gh-textarea class="post-setting-meta-description" id="meta-description" value=metaDescriptionScratch name="post-setting-meta-description" focus-out="setMetaDescription" stopEnterKeyDownPropagation="true"}}
                <p><b>80</b> 字以内效果最佳。 已输入 {{gh-count-down-characters metaDescriptionScratch 80}} 个字</p>
            </div>

            <div class="form-group">
                <label>搜索引擎呈现效果预览</label>
                <div class="seo-preview">
                    <div class="seo-preview-title">{{seoTitle}}</div>
                    <div class="seo-preview-description">{{seoDescription}}</div>
                    <div class="seo-preview-link">{{seoURL}}</div>
                </div>
            </div>
            </form>
        </div>{{! .settings-menu-content }}
        {{/if}}
    {{/gh-tab-pane}}
    </div>
</div>
{{/gh-tabs-manager}}
